﻿using Simple.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Service
/// <summary>
/// 版 本 钢易智企2.0 V 2.0.0 钢易智企2.0
/// Copyright (c) 2023 杭州钢易科技有限公司
/// 创建人：曾东明
/// 日 期：2024
/// 描 述：
/// </summary>
{
	public class BaseService
	{
		public BaseService() { }

		#region 200
		public BaseMessage Ok200(string message)
		{
			return new BaseMessage(message,200);
		}

		public BaseMessage Ok200<TData>(List<TData> data,string message)
		{
			return new PageMessage<TData>(data, message, 200);
		}

		public BaseMessage Ok200<TData>(List<TData> data)
		{
			return new PageMessage<TData>(data,200);
		}

		public BaseMessage ReturnOk200(object data)
		{
			return new SimpleMessage(data);
		}
		public BaseMessage ReturnOk200(object data,string message)
		{
			return new SimpleMessage(data,message,200);
		}

		#endregion

		#region 400
		public BaseMessage Bad400(string message)
		{
			return new BaseMessage(message, 400);
		}

		public BaseMessage ReturnBad400(object data, string message)
		{
			return new SimpleMessage(data, message, 400);
		}
		#endregion

		#region 500
		public BaseMessage Bad500(string message)
		{
			return new BaseMessage(message, 500);
		}
		public BaseMessage ReturnBad500(object obj,string message)
		{
			return new SimpleMessage(obj, message, 500);
		}
		#endregion

	}
}
